package ru.amse.ilyin.gui;

import java.awt.Graphics;

import ru.amse.ilyin.diagram.Renderer;

/**
 * An AWT renderer.
 *
 * @author Alexander Ilyin
 */
public class AWTRenderer implements Renderer {
	private final Graphics graphics;
	
	/**
	 * Creates an AWT renderer.
	 * 
	 * @param g graphics
	 */
	public AWTRenderer(Graphics g) {
		graphics = g;
	}

	public void drawLine(int x1, int y1, int x2, int y2) {
		graphics.drawLine(x1, y1, x2, y2);
	}

	public void drawOval(int x, int y, int width, int height) {
		graphics.drawOval(x, y, width, height);
	}

	public void drawString(String string, int x, int y) {
		graphics.drawString(string, x, y);
	}
	
	public void drawRectangle(int x, int y, int width, int height) {
		graphics.drawRect(x, y, width, height);
	}
}
